﻿<!-- Phan khai bao bien cuc bo-->
<?php
if ($v_listtype_id >0) {
	$v_listtype_id = $arr_single_listtype[0]['0'];
	$v_listtype_code = _replace_bad_char($arr_single_listtype[0]['1']);
	$v_listtype_name = _replace_bad_char($arr_single_listtype[0]['2']);
	$v_listtype_order = $arr_single_listtype[0]['3'];
	$v_listtype_have_file = $arr_single_listtype[0]['4'];
	$v_listtype_status =$arr_single_listtype[0]['5'];
	$v_save_and_add_new=0;
} else {
	$v_listtype_id = 0;
	$v_listtype_code = "";
	$v_listtype_name = "";
	$v_listtype_have_file = 0;
	$v_listtype_order = _get_next_value("T_ONEGATE_LISTTYPE","C_ORDER","");
	$v_listtype_status =1;
	$v_save_and_add_new=1;
}
$v_enable = "";
$v_readonly = "";
$v_str_save_and_add_new_checked="";
if ($v_save_and_add_new==1){
	$v_str_save_and_add_new_checked="checked";
}
$v_filter = "";
if(isset($_REQUEST['hdn_filter'])){
	$v_filter=_replace_bad_char(trim($_REQUEST['hdn_filter']));
}	
$v_str_listtype_checked="";
if ($v_listtype_status==1){
	$v_str_listtype_checked="checked";
}
$v_str_listtype_have_file="";
if ($v_listtype_have_file==1){
	$v_str_listtype_have_file="checked";
}
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="large_title">
		<td><?php echo CONST_LISTTYPE_UPDATE_TITLE; ?></td>
	</tr>
</table>
<form action="index.php" method="post" name="f_dsp_single_status">
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua cac text box de nhap du lieu-->
<table width="100%" class="form_table1">
	<col width="20%"><col width="60%"><col width="20%">
	<tr>
		<input type="hidden" name="fuseaction" value="UPDATE_LISTTYPE" >
		<input type="hidden" name="hdn_listtype_id" value="<?php echo $v_listtype_id ?>" >
		<input type="hidden" name="hdn_item_id" value="<?php echo $v_listtype_id ?>" >
		<input type="hidden" name="hdn_listtype_status" value="<?php echo $v_listtype_status ?>" >
		<input type="hidden" name="hdn_listtype_have_file" value="<?php echo $v_listtype_have_file ?>" >
		<input type="hidden" name="hdn_save_and_add_new" value="<?php echo $v_save_and_add_new; ?>"> 
		<input name="hdn_filter" type="hidden" value="<?php echo $v_filter; ?>">
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_LISTTYPE_CODE_LABEL; ?><small class="normal_starmark">*</small></td>
		<td><input  name="txt_code" type="text" <?php echo $v_readonly; ?> class="normal_textbox" style="width:60%" value="<?php echo $v_listtype_code; ?>" maxlength="<?php echo CONST_LISTTYPE_CODE_MAXLENGTH; ?>" message="<?php echo CONST_LISTTYPE_CODE_MESSAGE;?>" optional="<?php echo CONST_LISTTYPE_CODE_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_LISTTYPE_NAME_LABEL; ?> <small class="normal_starmark">*</small></td>
		<td><input name="txt_name" type="text" <?php echo $v_readonly; ?> class="normal_textbox" style="width:95%" value="<?php echo $v_listtype_name; ?>" maxlength="<?php echo CONST_LISTTYPE_NAME_MAXLENGTH;?>" message="<?php echo CONST_LISTTYPE_NAME_MESSAGE;?>" optional="<?php echo CONST_LISTTYPE_NAME_OPTIONAL;?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_ORDER_LABEL; ?></td>
		<td><input name="txt_order" type="text" <?php echo $v_readonly; ?> class="short_number_textbox" value="<?php echo $v_listtype_order; ?>" maxlength="<?php echo CONST_LISTTYPE_ORDER_MAXLENGTH;?>" message="<?php echo CONST_LISTTYPE_ORDER_MESSAGE;?>" optional="<?php echo CONST_LISTTYPE_ORDER_OPTIONAL;?>" isnumeric="<?php echo CONST_LISTTYPE_ORDER_ISNUMERIC; ?>" min="<?php echo CONST_LISTTYPE_ORDER_MIN; ?>" max="<?php echo CONST_LISTTYPE_ORDER_MAX; ?>" onKeyDown="change_focus(document.forms(0),this)"></td>
	</tr>
	<tr class="normal_label">
		<td>&nbsp;</td>
		<td><input type="checkbox" name="chk_have_file" <?php echo $v_enable;?> class="normal_checkbox" <?php echo $v_str_listtype_have_file;?> onClick="btn_single_checkbox_onclick(document.forms(0).chk_have_file,document.forms(0).hdn_listtype_have_file)" onKeyDown="change_focus(document.forms(0),this)"> <?php echo CONST_LISTTYPE_HAVE_FILE;?></td>
	</tr>
	<tr class="normal_label">
		<td>&nbsp;</td>
		<td><input type="checkbox" name="chk_status" <?php echo $v_enable;?> class="normal_checkbox" <?php echo $v_str_listtype_checked;?> onClick="btn_single_checkbox_onclick(document.forms(0).chk_status,document.forms(0).hdn_listtype_status)" onKeyDown="change_focus(document.forms(0),this)"> <?php echo _CONST_STATUS_COLUMN_ACTIVE_VALUE;?></td>
	</tr>
	<tr class="normal_label">
		<td height="37"></td>
		<td><input type="checkbox" name="chk_save_and_add_new" <?php echo $v_enable;?> class="normal_checkbox" <?php echo $v_str_save_and_add_new_checked; ?> onclick="btn_single_checkbox_onclick(document.forms(0).chk_save_and_add_new,document.forms(0).hdn_save_and_add_new)" onKeyDown="change_focus(document.forms(0),this)"><?php echo _CONST_SAVE_AND_ADD_NEW_LABEL;?></td>
	</tr>
</table>
<!--bang chua cac button-->
<table width="100%" >
	<tr>
		<td align="center" width="100%" height="40" valign="bottom"><?php
			if ($v_is_granted_update){?>
				<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_onclick('UPDATE_LISTTYPE')" onKeyDown="change_focus(document.forms(0),this)"><?php
			}?>
				<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">	
		</td>
	</tr>
</table>					
</div>
</form>
<script language="JavaScript">
	set_focus(document.forms(0));
	window.dialogHeight = "340pt";
	window.dialogWidth = "420pt";
	window.dialogTop = "80pt";
</script>
